﻿using AppMachine.Domain.LogicCom;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace AppMachine.EntityFrameworkCore.EntityTypeConfiguration;
internal class ComConfigEntityTypeConfiguration : IEntityTypeConfiguration<AppComConfig> {
    public void Configure(EntityTypeBuilder<AppComConfig> builder) {
        builder.ToTable($"AppMachine.{nameof(AppComConfig)}");
        builder.HasKey(it => it.ComID);
        builder.HasIndex(it => it.ComID);
        builder.Property(it => it.ComID).HasMaxLength(50);
        builder.ConfigureAutoID();
    }
}
